package cn.shutdown.demo.thread.interrupt.sleep02;

/**
 * @author jiangwujie
 * @date 2021/8/9
 */
public class MyThread extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 1000000; i++) {
            System.out.println("i=" + (i + 1));
        }
        try {
            System.out.println("begin");
            Thread.sleep(20000);
            System.out.println("end");
        } catch (InterruptedException e) {
            System.out.println("sleep遭到终止, interrupted" + currentThread().isInterrupted());
        }
    }
}
